function getParameterByName(name, url) {
  // if (!url) url = window.location.href;
  console.log(name);
  console.log(url);
  const replacedName = name.replace(/[[\]]/g, '\\$&');
  console.log(replacedName);
  const regex = new RegExp(`[?&]${replacedName}(=([^&#]*)|&|#|$)`);
  const results = regex.exec(url);
  console.log(results)

  if (!results) return null;
  if (!results[2]) return '';
  const value = decodeURIComponent(results[2].replace(/\+/g, ' '));
  console.log(value)
  return value
}

module.exports = {
  getParameterByName
}